<div class="msg">
    <div class="icon"><i class="{$style}"></i></div>
    <div class="title">{$msg}</div>
    {if urldecode($url)!='stop' }
    <button type="button" class="weui-btn weui-btn_primary" onclick="goToPage()">确定<span id="showTime"></span></button>
    {/if}
</div>


<script type="text/javascript">
    // 页面跳转
    var url = "{:urldecode($url)}";
    var backstep = parseInt("{$backstep}");
    
    function goToPage() {
        if (backstep > 0) {
            history.go(-backstep);
        } else {
            if (url == '') {
                history.back();
            } else if (url == 'close') {
                closeWin();
            } else if (url == 'stop') {
                ;
            } else {
                location.replace(url);
            }
        }
    }

    // 倒计时时间
    var time = parseInt("{$time}");
    function autoTimeShow() {
        --time;
        if (time < 0) {
            document.getElementById('showTime').innerHTML = '';
            goToPage();
            return;
        }
        document.getElementById('showTime').innerHTML = '(' + time + ')';
        setTimeout(autoTimeShow, 1000);
    }

    function closeWin() {
        try {
            window.opener = window;
            var win = window.open("", "_self");
            win.close();
            //frame的时候
            top.close();
        } catch (e) {

        }
    }

    autoTimeShow();
</script>